home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / turbovis / tvtool17.zip / ASCII.H < prev    next >
C/C++ Source or Header  |  1993-01-14  |  3KB  |  133 lines

  1. /*-------------------------------------------------------*/
  2. /*                                                       */
  3. /*   Ascii.h: Header file for Ascii.cpp                  */
  4. /*-------------------------------------------------------*/
  5.  
  6. #if ! defined( __ASCII_H ) && defined(Uses_TAsciiChart)
  7. #define __ASCII_H
  8.  
  9.  
  10. const int cmAsciiTableCmdBase = 910;
  11. const int cmCharFocused       =   0;
  12.  
  13.          
  14.  
  15. class TTable : public TView
  16. {
  17.  
  18. public:
  19.  
  20.     TTable( TRect& r );
  21.     TTable( StreamableInit ) : TView(streamableInit) { };
  22.     virtual void draw();
  23.     virtual void handleEvent( TEvent& event );
  24.     void charFocused();
  25.  
  26. private:
  27.  
  28.     virtual const char *streamableName() const
  29.         { return name; }
  30.  
  31. protected:
  32.  
  33.     virtual void write( opstream& );
  34.     virtual void *read( ipstream& );
  35.  
  36. public:
  37.  
  38.     static const char * const name;
  39.     static TStreamable *build();
  40.  
  41. };
  42.  
  43.  
  44. inline ipstream& operator >> ( ipstream& is, TTable& cl )
  45.     { return is >> (TStreamable&) cl; }
  46. inline ipstream& operator >> ( ipstream& is, TTable*& cl )
  47.     { return is >> (void *&) cl; }
  48.  
  49. inline opstream& operator << ( opstream& os, TTable& cl )
  50.     { return os << (TStreamable&) cl; }
  51. inline opstream& operator << ( opstream& os, TTable* cl )
  52.     { return os << (TStreamable *) cl; }
  53.  
  54.  
  55. class TReport : public TView
  56. {
  57.  
  58. public:
  59.  
  60.     TReport( TRect& r );
  61.     TReport( StreamableInit ) : TView(streamableInit) { };
  62.     virtual void draw();
  63.     virtual void handleEvent( TEvent& event );
  64.  
  65. private:
  66.  
  67.     long asciiChar;
  68.  
  69.     virtual const char *streamableName() const
  70.     { return name; }
  71.  
  72. protected:
  73.  
  74.     virtual void write( opstream& );
  75.     virtual void *read( ipstream& );
  76.  
  77. public:
  78.  
  79.     static const char * const name;
  80.     static TStreamable *build();
  81.  
  82. };
  83.  
  84. inline ipstream& operator >> ( ipstream& is, TReport& cl )
  85.     { return is >> (TStreamable&) cl; }
  86. inline ipstream& operator >> ( ipstream& is, TReport*& cl )
  87.     { return is >> (void *&) cl; }
  88.  
  89. inline opstream& operator << ( opstream& os, TReport& cl )
  90.     { return os << (TStreamable&) cl; }
  91. inline opstream& operator << ( opstream& os, TReport* cl )
  92.     { return os << (TStreamable *) cl; }
  93.  
  94.  
  95. class TAsciiChart : public TWindow
  96. {
  97.  
  98. public:
  99.  
  100.     TAsciiChart();
  101.     TAsciiChart( StreamableInit ) : TWindow(streamableInit),
  102.                     TWindowInit(&initFrame) { };
  103.  
  104. private:
  105.  
  106.     virtual const char *streamableName() const
  107.     { return name; }
  108.  
  109. protected:
  110.  
  111.     virtual void write( opstream& );
  112.     virtual void *read( ipstream& );
  113.  
  114. public:
  115.  
  116.     static const char * const name;
  117.     static TStreamable *build();
  118.  
  119. };
  120.  
  121. inline ipstream& operator >> ( ipstream& is, TAsciiChart& cl )
  122.     { return is >> (TStreamable&) cl; }
  123. inline ipstream& operator >> ( ipstream& is, TAsciiChart*& cl )
  124.     { return is >> (void *&) cl; }
  125.  
  126. inline opstream& operator << ( opstream& os, TAsciiChart& cl )
  127.     { return os << (TStreamable&) cl; }
  128. inline opstream& operator << ( opstream& os, TAsciiChart* cl )
  129.     { return os << (TStreamable *) cl; }
  130.  
  131. #endif      // __ASCII_H
  132.  
  133.